from dataclasses import dataclass

from src.application.category.dto import CategoryDTO
from src.application.category.uow import CategoryUoW


@dataclass(frozen=True)
class GetCategoryForPrivate:
    country_id: int
    provider_id: int


class GetCategoryForPrivateHandler:
    """
    Получение категорию для приватных прокси
    """

    def __init__(self, *, uow: CategoryUoW) -> None:
        self._uow = uow

    async def __call__(self, command: GetCategoryForPrivate) -> CategoryDTO:
        return await self._uow.category_reader.get_category_for_private(
            country_id=command.country_id, provider_id=command.provider_id
        )
